//
//  SlideViewController.h
//  ActiveDeck
//
//  Created by Chiao-Wei Liu on 2011/2/10.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "GDataXMLNode.h"
#import "PageViewController.h"
#import "AD_Slide.h"
#import "AD_Kiosk.h"
#import "AD_ContainerOB.h"

@interface SlideViewController : UIViewController {
	NSMutableArray *pageVCSets;
	
	NSArray *PageOBs;
	NSString *PID;
    NSString *PresentName;
    int PageID;
	int GPageIndex;
    int numberCorrect;
    int numberIncorrect;
    
    int SlideIndex;
    int SlideCount;
    
	GDataXMLElement *userData;
    AD_Slide *SlideOB;
    AD_Kiosk *KioskOB;
    id _delegate;  
    
    NSMutableArray *allPages;
    AD_ContainerOB *ContainOB;
    
    BOOL isForPDF;
    BOOL canExportToPDF;
}
@property (readwrite) int SlideIndex;
@property (readwrite) int SlideCount;
@property (nonatomic, retain) AD_ContainerOB *ContainOB;
@property (nonatomic, retain) GDataXMLElement *userData;
@property (nonatomic, retain) AD_Slide *SlideOB;
@property (nonatomic, retain) AD_Kiosk *KioskOB;

@property(nonatomic, retain) NSString *PresentName;
@property(nonatomic, retain) NSString *PID;
@property(nonatomic, retain	) NSArray *PageOBs;
@property(nonatomic, retain) NSMutableArray *pageVCSets;

@property(readwrite) int PageID;
@property(readwrite) int GPageIndex;
@property(readwrite) int numberCorrect;
@property(readwrite) int numberIncorrect;
@property(nonatomic, retain) NSMutableArray *allPages;
@property(readwrite) BOOL isForPDF;
@property(readwrite) BOOL canExportToPDF;

-(GDataXMLElement *)XMLBuilder;
-(void)unloadViewWithPage:(int)pageIndex;
-(void)changePage:(int)pageIndex direction:(UIViewAnimationDirection)direction;
-(void)changePage:(int)pageIndex direction:(UIViewAnimationDirection)direction recordHistory:(BOOL)shouldRecord;
-(void)loadViewWithPage:(int)pageIndex display:(BOOL)show recordToHistory:(BOOL)shouldRecord;
-(void)loadViewWithPage:(int)pageIndex display:(BOOL)show doTransition:(BOOL)shouldAnimate recordToHistory:(BOOL)shouldRecord;
-(void)loadViewWithPage:(int)pageIndex display:(BOOL)show direction:(UIViewAnimationDirection)direction doTransition:(BOOL)shouldAnimate recordToHistory:(BOOL)shouldRecord;

-(id)delegate;
-(void)setDelegate:(id)delegate;
-(void)jumpToPage:(int)NewPageID;
-(void)jumpToPage:(int)NewPageID recordHistory:(BOOL)shouldRecord;
-(void)idleReset;
-(void)unloadViews:(int)pIndex;
-(void)updateSubmitStatus;
-(void)updateCorrectAnswers:(int)numCorrect:(int)numIncorrect;
-(void)rotateForMovie:(BOOL)shouldRotate;
-(void)setUpdateStatus:(BOOL)shouldUpdate:(PageViewController*)sender;
-(void)exportPDF;
-(void)navigateBackwards;
-(void)recordNavigationHistory:(BOOL)recordToHistory:(int)pageID:(int)slideIndex;
-(void)updateSecondaryChannelID:(int)key;
@end

@interface NSObject(newPresentDelegate)
- (void)newPresentation;
- (void)jumpSection:(int)SectionID
         oldSection:(int)OldSectionID
           jumpPage:(int)Page;
- (void)resetIdleTimer;
- (void)updateAnswerCount:(int)numCorrect:(int)numIncorrect;
- (void)SaveIntoFile;
- (void)ShowCamera:(PageViewController *)sender;
- (void)exportToPDF:(NSMutableArray*)currentPosition;
@end